<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<div th:replace="common/header::header('考生信息录入')"></div>
<script>
//    <!--动态获取考试列表-->
    function getExam(){
        $.ajax({
            type : "post",
            url : "/erems/exam/examList",    //url根据自己的项目实际定义
            async : false,
            dataType : "text",
            error : function() {
                alert("系统忙，请稍后再试！");
                return false;
            },
            success : function(text) {
                var expressExam= $("#examId");
                var str = '';
                var data = eval("("+text+")");
                expressExam.empty();
                for(var o in data) {
                    str += '<option value="'+data[o].id+'">'+data[o].name+'</option>';
                }
                expressExam.append(str);
            }
        });
    }
//获取地区
    function getAreaList() {
        $.ajax({
            type: "post",
            url: "/erems/admin/areaList",    //url根据自己的项目实际定义
            async: false,
            dataType: "text",
            error: function () {
                alert("系统忙，请稍后再试！");
                return false;
            },
            success: function (text) {
                var expressExam = $("#addressId");
                var str = '';
                var data = eval("(" + text + ")");
                expressExam.empty();
                for (var o in data) {
                        str += '<option value="' + data[o].id + '">' + data[o].province + data[o].city + '</option>';
                }
                expressExam.append(str);
            }
        });
    }

    function loadf() {
        getExam();
        getAreaList();
    }
</script>
<body onload="loadf()">
<div id="wrapper" class="row">
    <div th:replace="common/header::nav"></div>
    <div id="page-inner">
        <div class="row">
            <div class="col-md-6 col-md-offset-3">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        考生信息录入表
                    </div>
                    <div class="panel-body">
                        <form action="/erems/manager/saveExaminee" method="post">
                            <div class="table-responsive">
                                <div th:text="${msg}" style="color: red;"></div>
                                <div th:text="${msgSuccess}" style="color: green;"></div>
                                <table class="table table-striped table-hover">
                                    <thead>
                                    <tr>
                                        <th style="width:40%;"></th>
                                        <th>信息</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>姓名</td>
                                        <td>
                                            <input type="text" id="name" name="name" class="required" placeholder="姓名"
                                                   value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>用户名</td>
                                        <td>
                                            <input type="text" id="username" name="username" class="required" placeholder="用户名"
                                               value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>性别</td>
                                        <td>
                                            <select id="sex" name="sex">
                                                <option value="男">男</option>
                                                <option value="女">女</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>邮箱</td>
                                        <td>
                                            <input type="text" id="email" name="email" class="required" placeholder="邮箱"
                                                   value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>电话</td>
                                        <td>
                                            <input type="text" id="phone" name="phone" class="required" placeholder="电话"
                                                   value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>身份证号</td>
                                        <td>
                                            <input type="text" id="idnumber" name="idnumber" class="required" placeholder="身份证号"
                                                   value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>教育背景</td>
                                        <td>
                                            <input type="text" id="eduback" name="eduback" class="required" placeholder="教育背景"
                                                   value="">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>地址</td>
                                        <td>
                                            <select id="addressId" name="address.id">
                                                <option>全部</option>
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>报名考试</td>
                                        <td>
                                            <select id="examId" name="examId">
                                                <option value="">全部</option>
                                            </select>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                                <button type="submit" class="btn btn-primary">插入</button>
                                <button class="btn btn-warning">
                                    <a href="javascript:history.go(-1)" style="color:white;">取消</a>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <!-- /. ROW  -->
    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. WRAPPER  -->

<div th:replace="common/footer"></div>
</body>
</html>